//aqui empieza mi script

void OnStart()
{

if (ScriptDebugOn ())
		
		 GiveItemFromFile ("Lantern", "Lantern.ent");
		 for (int i=0; i<10; i++)
		 {
		 GiveItemFromFile ("tinderbox", "tinderbox.ent");
		 }
AddUseItemCallback("Key_1", "Key", "puerta1", "KeyOnDoor", true);
SetLocalVarInt("Var1", 0);
SetEntityConnectionStateChangeCallback("palanca", "AbrirEstanteria");
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("puerta1",false,true);
PlaySoundAtEntity ("", "open_door.snt", "puerta1", 0, false);
RemoveItem("Key");
}



void AbrirEstanteria(string &in asEntity, int alState)
{
     if (alState == 1)
     {
     AddLocalVarInt("Var1", 1);
     func01();
     }
}
  
void func01()
{
if(GetLocalVarInt("Var1") == 2)
    {
    SetMoveObjectState("estanteria",1.0f);
    PlaySoundAtEntity("", "quest_completed.snt", "estanteria", 0, false);
    }
	
}




void OnEnter ()
{

}

